package com.pinyoumei.app.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.pinyoumei.app.R;
import com.pinyoumei.app.bean.MessageBean;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

/**
 * Created by Administrator on 2021-08-09.
 * --------- 日期 ------- 维护人 ------------ 变更内容 --------
 * 2021-08-09        Administrator             新增Person类
 * 2021-08-09        Administrator             增加sex属性
 */
public class Message1Adapter extends BaseQuickAdapter<MessageBean.ResultBean.DataListBean, BaseViewHolder> {
    public Message1Adapter(int layoutResId, @Nullable List<MessageBean.ResultBean.DataListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MessageBean.ResultBean.DataListBean item) {
        ImageView imageView = helper.getView(R.id.iv_bg);
//        Glide.with(mContext).load(item.getGoods_img()).into(imageView);


        helper.setText(R.id.tv_title, item.getTitle());

        helper.setText(R.id.tv_add_time, item.getAdd_time());

        helper.setText(R.id.tv_notice_content, item.getNotice_content());


// 1团购红包 2广告红包 3余额支付 4微信支付 5支付宝支付 6提现成功
// 7提现失败 8余额退回 9 团购返佣 10 返利返佣
        switch (item.getNotice_kind()) {
            case 1:
                imageView.setImageResource(R.mipmap.ic_msg_1);
                break;

            case 2:
                imageView.setImageResource(R.mipmap.ic_msg_2);
                break;
            case 3:
                imageView.setImageResource(R.mipmap.ic_msg_3);
                break;
            case 4:
                imageView.setImageResource(R.mipmap.ic_msg_4);
                break;
            case 5:
                imageView.setImageResource(R.mipmap.ic_msg_5);
                break;
            case 6:
                imageView.setImageResource(R.mipmap.ic_msg_6);
                break;
            case 7:
                imageView.setImageResource(R.mipmap.ic_msg_7);
                break;
            case 8:
                imageView.setImageResource(R.mipmap.ic_msg_8);
                break;
            case 9:
                imageView.setImageResource(R.mipmap.ic_msg_9);
                break;
            case 10:
                imageView.setImageResource(R.mipmap.ic_msg_10);
                break;

            default:
                break;
        }
    }
}
